#ifndef __LOG__H__
#define __LOG__H__

#include "Lock.h"

#include <stdio.h>

extern volatile uint64_t log_lock;

#define LOG(fmt, ...)                                            \
    do                                                           \
    {                                                            \
        spin_lock(&log_lock);                                    \
        printf("[%s:%d@%s] ", __FILE__, __LINE__, __FUNCTION__); \
        printf(fmt, ##__VA_ARGS__);                              \
        spin_unlock(&log_lock);                                  \
    } while (0)

#endif